package com.imooc.luckymoney.luck;

import com.imooc.luckymoney.luck.Luckmoney;
import com.imooc.luckymoney.luck.LuckymoneyRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * The type Luckymoney service.
 */
@Service
public class LuckymoneyService {

    @Autowired
    private LuckymoneyRepository repository;

    public void createTwo() {
        Luckmoney luckmoney = new Luckmoney();
        luckmoney.setProducer("Andy1");
        luckmoney.setMoney(new BigDecimal("1314"));
        repository.save(luckmoney);

        Luckmoney luckmoney2 = new Luckmoney();
        luckmoney2.setProducer("Andy1");
        luckmoney2.setMoney(new BigDecimal("520"));
        repository.save(luckmoney2);
    }
}
